We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vihanrs/weather-xmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { z } from "zod";
import { type ResourceMetadata, type InferSchema } from "xmcp";
import { getCurrentWeather } from "../../../lib/weather-api";
export const schema = {
city: z.string().describe("City name"),
};
export const metadata: ResourceMetadata = {
name: "current-weather",
title: "Current Weather",
description: "Current weather data for a city",
mimeType: "application/json",
};
export default async function handler({ city }: InferSchema<typeof schema>) {
const weather = await getCurrentWeather(city);
return JSON.stringify(weather, null, 2);
}